﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Professor.aspx.cs" Inherits="Professor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <h2>
    Professores:</h2>
<p>
    <asp:Button ID="BtnNovoProf" runat="server" Text="Cadastrar Professor" 
        onclick="BtnNovoProf_Click" />
</p>
    <p><strong>Busca:</strong> <br />
        Nome:
        <asp:TextBox ID="txtNome" runat="server" Width="255px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Matrícula:
        <asp:TextBox ID="txtMatricula" runat="server" 
            Width="168px"></asp:TextBox><br />

        <br /><asp:Button ID="btnBuscar" runat="server" Text="Buscar" 
            onclick="btnBuscar_Click" />
<br /></p>
<p>
    <asp:GridView ID="GridViewProf" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ObjectDataSource1">
        <Columns>
            <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
            <asp:BoundField DataField="Matricula" HeaderText="Matricula" 
                SortExpression="Matricula" />
            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
            <asp:BoundField DataField="Sexo" HeaderText="Sexo" SortExpression="Sexo" />
            <asp:HyperLinkField DataNavigateUrlFields="id" 
                DataNavigateUrlFormatString="ProfessorInserir.aspx?id={0}" 
                Text="Visualizar Informações" />
        </Columns>
    </asp:GridView>
</p>
<p>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        DataObjectTypeName="Dominio.ProfessorVO" DeleteMethod="excluir" 
        InsertMethod="salvar" SelectMethod="list" TypeName="Negocio.ProfessorNegocio" 
        UpdateMethod="salvar">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtNome" Name="nome" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="txtMatricula" Name="matricula" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</p>
</asp:Content>

